#include<stdio.h>
int main(void)
{
int a;
float b;
printf("input data:");
scanf("%d",&a);
if(a<-2)b=a+2;
if(-2<=a&&a<0)b=0;
if(0<=a&&a<2)b=a*a/2;
if(a>=2)b=3*a-2;
printf("a=%d,b=%f",a,b);

return 0;
}
